package pagereplace;

public class HitRate {
	private int num;
	private double hitOPT;
	private double hitFIFO;
	private double hitLRU;

	HitRate(){
		
	}
	HitRate(int[]page, int cache){
		setNum(cache);
		setHit(page);
	}
	
	public String getNum() {
		return "[" + num + "]";
	}
	public void setNum(int num) {
		this.num = num;
	}
	public double getHitOPT() {
		return hitOPT;
	}
	public void setHitOPT(double hitOPT) {
		this.hitOPT = hitOPT;
	}
	public double getHitFIFO() {
		return hitFIFO;
	}
	public void setHitFIFO(double hitFIFO) {
		this.hitFIFO = hitFIFO;
	}
	public double getHitLRU() {
		return hitLRU;
	}
	public void setHitLRU(double hitLRU) {
		this.hitLRU = hitLRU;
	}
	
	public void setHit(int[] page) {
		OPT opt = new OPT();
	    FIFO fifo = new FIFO();
	    LRU lru = new LRU();
		hitOPT = opt.getOPT(page, num);
		hitFIFO = fifo.getFIFO(page, num);
		hitLRU = lru.getLRU(page, num);
	}
	
}
